

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;

namespace DataLayer
{
	public class datReferrers
	{
		public datReferrers()
		{
		}
		
		#region  Code Factory Generated Methods
		
		public void InsertReferrers(entReferrers parEntReferrers, DbConnector parDbConnector)
		{
			DbParamCollection insDbParamCollection = new DbParamCollection();
			insDbParamCollection.Add("@pReferrerAddress",parEntReferrers.ReferrerAddress);
			insDbParamCollection.Add("@pIpAddress",parEntReferrers.IpAddress);
			insDbParamCollection.Add("@pBrowser",parEntReferrers.Browser);
			insDbParamCollection.Add("@pLanguageId",parEntReferrers.LanguageId);
			insDbParamCollection.Add("@pPageId",parEntReferrers.PageId);
			insDbParamCollection.Add("@pReferrerDate",parEntReferrers.ReferrerDate);
			insDbParamCollection.Add("@pIsRssReferrer",parEntReferrers.IsRssReferrer);
			insDbParamCollection.AddOutput("@pReferrerId",DbType.Int32);
			parDbConnector.ExecuteNonQuery("InsertReferrers",insDbParamCollection);
			parEntReferrers.ReferrerId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
		}
		
		#endregion

        public DataTable ReportTopVisitedPages(DateTime parStartDate, DateTime parEndDate, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pStartDate", parStartDate);
            insDbParamCollection.Add("@pEndDate", parEndDate);
            return parDbConnector.ExecuteDataTable("ReportTopVisitedPages", insDbParamCollection);
        }
        public DataTable ReportPageViews(DateTime parStartDate, DateTime parEndDate, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pStartDate", parStartDate);
            insDbParamCollection.Add("@pEndDate", parEndDate);
            return parDbConnector.ExecuteDataTable("ReportPageViews", insDbParamCollection);
        }
        public DataTable ReportPageViewsLanguageDetailed(DateTime parStartDate, DateTime parEndDate, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pStartDate", parStartDate);
            insDbParamCollection.Add("@pEndDate", parEndDate);
            return parDbConnector.ExecuteDataTable("ReportPageViewsLanguageDetailed", insDbParamCollection);
        }
        public DataTable ReportReferrers(DateTime parStartDate, DateTime parEndDate, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pStartDate", parStartDate);
            insDbParamCollection.Add("@pEndDate", parEndDate);
            return parDbConnector.ExecuteDataTable("ReportReferrers", insDbParamCollection);
        }
	}
}